import request from '@/utils/request'

// 获取-分页查询角色列表
export const getRoles = (params) => request.get('/sys/role', { params })

// 新增-角色
export const addRoles = (data) => request.post('/sys/role', data)

// 修改-角色
export const updateRoles = (data) => request.put('/sys/role/' + data.id, data)

// 删除-角色
export const delRoles = id => request.delete('/sys/role/' + id)

// 查询已启用
export const getRolesList = () => request.get('/sys/role/list/enabled')

// 获取角色详情
export const getRolesxiang = id => request.get(`/sys/role/${id}`)

// 给角色分配权限
export const assignPerm = (data) => request.put('/sys/role/assignPrem', data)

// export function assignPerm(data) {
//   return request({
//     url: '/sys/role/assignPrem',
//     method: 'put',
//     data
//   })
// }
